package com.ptswitch.material.web.action;

import org.springframework.stereotype.Controller;

import com.ptswitch.material.model.EMailAddress;

@Controller("eMailAddressAction")
public class EMailAddressAction extends ActionSupport{
	
	private EMailAddress eMailAddress;

	// save
	public String add() {
		mustAdmin();
		eMailAddressSer.save(eMailAddress);
		eMailAddress=null;
		return "userList";
	}

	// delete
	public String delete() {
		mustAdmin();
		eMailAddressSer.delete(id);
		return "userList";
	}

	public String deleteAll() {
		mustAdmin();
		eMailAddressSer.deleteAll();
		return "userList";
	}

	// get and set

	public EMailAddress getEMailAddress() {
		if(eMailAddress==null){
			eMailAddress=new EMailAddress();
		}
		return eMailAddress;
	}

}
